#!/bin/sh
cd $2
tail -n $1 $3> /tmp/$3.temp